package com.atguigu.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.atguigu.entity.Dict;
import com.atguigu.result.Result;
import com.atguigu.service.CommunityService;
import com.atguigu.service.DictService;
import com.atguigu.vo.HouseQueryVo;
import com.github.pagehelper.PageHelper;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author lhh
 * @ClassName DictController
 * @date 2022/9/23 11:24
 */
@RestController
@RequestMapping("dict")
public class DictController {

    @Reference
    private DictService dictService;

    @GetMapping("findListByDictCode/{dictCode}")
    public Result findListByDictCode(@PathVariable String dictCode){
        List<Dict> dictList = dictService.findListByDictCode(dictCode);
        return Result.ok(dictList);
    }

    @GetMapping("findListByParentId/{plateId}")
    public Result getByParenId(@PathVariable Long plateId){
        List<Dict> list = dictService.findListByParentId(plateId);
        return Result.ok(list);
    }


}
